# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#


kmcmake_cc_test(
        NAME core_test
        MODULE verifier_unit_test
        SOURCES
        array_view_test.cpp
        array_writer_test.cpp
        cast_expr_test.cpp
        coalesce_test.cpp
        conjunct_test.cpp
        constant_flat_vector_reader_test.cpp
        custom_type_test.cpp
        expr_compiler_test.cpp
        expr_encodings_test.cpp
        expr_stats_test.cpp
        expr_test.cpp
        expr_to_subfield_filter_test.cpp
        eval_ctx_test.cpp
        eval_errors_test.cpp
        eval_simplified_test.cpp
        function_call_to_special_form_test.cpp
        generic_view_test.cpp
        generic_writer_test.cpp
        main.cpp
        map_view_test.cpp
        map_writer_test.cpp
        peeled_encoding_test.cpp
        reverse_signature_binder_test.cpp
        row_view_test.cpp
        row_writer_test.cpp
        signature_binder_test.cpp
        simple_function_preset_nulls_test.cpp
        simple_function_init_test.cpp
        simple_function_call_null_free_test.cpp
        simple_function_test.cpp
        string_writer_test.cpp
        try_expr_test.cpp
        variadic_view_test.cpp
        vector_reader_test.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        -fno-access-control
        LINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        pollux::expression_verifier_static
        GTest::gtest
        GTest::gtest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_library(
        NAMESPACE ${PROJECT_NAME}
        NAME expression_verifier
        SOURCES
        expression_verifier.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PLINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        GTest::gtest
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_library(
        NAMESPACE ${PROJECT_NAME}
        NAME expression_runner
        SOURCES
        expression_runner.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PLINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        GTest::gtest
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME runner_test
        MODULE runner_test
        SOURCES
        expression_runner_test.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        -fno-access-control
        LINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        pollux::expression_runner_static
        GTest::gtest
        GTest::gtest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME all_test
        MODULE verifier_unit_test
        SOURCES
        expression_verifier_unit_test.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        -fno-access-control
        LINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        pollux::expression_verifier_static
        GTest::gtest
        GTest::gtest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME runner_unit_test
        MODULE expression
        SOURCES
        expression_runner_unit_test.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        -fno-access-control
        LINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        pollux::expression_runner_static
        GTest::gtest
        GTest::gtest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME parse_type_signature_test
        MODULE expression
        SOURCES
        parse_type_signature_test.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        -fno-access-control
        LINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        pollux::expression_runner_static
        GTest::gtest
        GTest::gtest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_library(
        NAMESPACE ${PROJECT_NAME}
        NAME arg_types_generator_test_utils
        SOURCES
        fuzzer/arg_types_generator_test_utils.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PLINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        GTest::gtest
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME fuzzer_test
        MODULE expression
        SOURCES
        fuzzer/argument_type_fuzzer_test.cpp
        fuzzer/decimal_arg_types_generator_test.cpp
        fuzzer/expression_fuzzer_unit_test.cpp
        fuzzer/fuzzer_toolkit_test.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        -fno-access-control
        LINKS
        pollux::pollux_static
        pollux::pollux_testing_static
        pollux::arg_types_generator_test_utils_static
        GTest::gtest
        GTest::gtest_main
        ${KMCMAKE_DEPS_LINK}
)